package com.nowcoder.community.dao;

import com.nowcoder.community.entity.Message;
import com.nowcoder.community.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserMapper {

    User selectById(int id);

    // User selectByName(String username);

    List<User> selectByName(String username);

    // User selectByEmail(String email);

    List<User> selectByEmail(String email);

    /**
     * @param user
     * @return 返回插入成功行数
     */
    int insertUser(User user);

    /**
     * @param id
     * @param status
     * @return 返回修改成功函数
     */
    int updateStatus(int id, int status);

    int updateHeader(int id, String headerUrl);

    int updatePassword(int id, String password);

}
